package com.carleasoft.mps.cms.business.repairs.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.carleasoft.mps.cms.business.repairs.bean.entity.RepairsMessage;
import com.carleasoft.mps.cms.business.repairs.bean.entity.VehicleMessage;
import com.carleasoft.mps.cms.business.repairs.bean.po.RepairsMessagePagePo;
import com.carleasoft.mps.cms.business.repairs.bean.po.VehicleMessagePagePo;
import com.carleasoft.mps.cms.business.repairs.bean.vo.UserInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 网上报修 Mapper 接口
 * </p>
 *
 * @author fan
 * @since 2023-06-02
 */
@Mapper
public interface VehicleMessageMapper extends BaseMapper<VehicleMessage> {
    /**
     * 网上报修分页接口
     */
    Page<VehicleMessage> vehiclePage(Page page,@Param("po") VehicleMessagePagePo vehicleMessagePagePo);
    /**
     * 网上报修分页接口
     */
    Page<VehicleMessage> myVehiclePage(Page page,@Param("po") VehicleMessagePagePo vehicleMessagePagePo);
    /**
     * 网上报修分页接口
     */
    List<VehicleMessage> vehiclePage1(@Param("po") VehicleMessagePagePo vehicleMessagePagePo);
    /**
     * 条件查询网上报修数量
     * type 1 全部 2 办结
     */
    Integer repairsNum(@Param("type")Integer type,@Param("year")String year);
    /**
     * 根据月份查询各种留言
     * type 1-全部 2 已处理
     * sign 1-心理咨询 2-法律援助留言 3-信箱
     */
    Integer caseNum(@Param("type")Integer type, @Param("month") String month,@Param("sign") Integer sign);
    //根据月份查询报修数量
    //     * type 1-全部 2 已处理
    Integer caseNum1(@Param("type")Integer type, @Param("month") String month);

    /**
     * 获取今天报修申请数量
     * @return
     */
    Integer getTheDayNum(@Param("theDay") String theDay);
    /**
     * 根据参数统计报修数量
     * month 统计月 份
     * repairsType 报修类型（1-车辆报修 2-装备报修 3-营房报修）
     */
    Integer statisticsRepair(@Param("month")String month,@Param("repairsType") Integer repairsType);
    HashMap<String,Object> statisticsTheYear(@Param("year") String year);
    Integer mainTainNum(@Param("repairsType")Integer repairsType,@Param("status") Integer status);
    Integer statisticsByMonth(@Param("month")String month, @Param("repairsType") Integer repairsType);

    List<UserInfoVo> userInfo(@Param("userNames") Set<String> userNames);
}
